import java.text.DecimalFormat;
import java.util.*;
import java.lang.*;

public class Bequations {
    public static void main(String[] args) {
        int n;
        double a, b, c, d;
        DecimalFormat df = new DecimalFormat("0.00000");
        Scanner input = new Scanner(System.in);
        n = input.nextInt();
        for (; n > 0; n--) {
            a = input.nextDouble();
            b = input.nextDouble();
            c = input.nextDouble();
            if (b == 0)
                b = -b;
            d = b * b - 4 * a * c;
            if (d > 0) {
                System.out.print("x1=");
                System.out.print(df.format((Math.sqrt(d) - b) / 2 / a));
                System.out.print(";x2=");
                System.out.println(df.format((-Math.sqrt(d) - b) / 2 / a));
            }
            if (d == 0) {
                System.out.print("x1=x2=");
                System.out.println(df.format((-b - Math.sqrt(d)) / 2 / a));
            }
            if (d < 0) {
                double shi, xu;
                shi = -b / 2 / a;
                xu = Math.sqrt(-d) / 2 / a;
                System.out.print("x1=");
                System.out.print(df.format(shi) + "+" + df.format(xu) + "i");
                System.out.print(";x2=");
                System.out.println(df.format(shi) + "-" + df.format(xu) + "i");
            }
        }
    }
}